<template>
  <div id="aCoursesList" class="bg-fa of">
    <!-- /课程详情 开始 -->
    <section class="container">
      <section class="path-wrap txtOf hLh30">
        <a href="././" title class="c-999 fsize14">首页</a>
        \
        <a href="./" title class="c-999 fsize14">课程列表</a>
        \
        <span class="c-333 fsize14">{{course.title}}</span>
      </section>
      <div style="padding: 20px;background: #fff;border-radius: 22px;">
        <!--封面-->
        <article class="c-v-pic-wrap">
          <section class="p-h-video-box" id="videoPlay">
            <img :src="course.cover" :alt="course.title" class="dis c-v-pic" style="border-radius: 12px;">
          </section>
        </article>
        <aside class="c-attr-wrap" style="background: #fff;border-left: 1px solid #ddd;width: 350px">
          <section class="ml20 mr15">
            <h2 class="hLh30 txtOf mt15">
              <span class="c-333 fsize24" style="color: #333;font-size: 24px">{{course.title}}</span>
            </h2>
            <section class="c-attr-jg" style="border-bottom: none">
              <div data-v-4c942fd4="" class="has-button" v-if="Number(course.price) === 0">本课程免费</div>
              <div v-else>
                <span class="c-333">价格：</span>
                <b class="d-red" style="font-size:24px;">￥{{course.price}}</b>
              </div>
            </section>
            <section class="c-attr-mt c-attr-undis">
              <span class="c-333 fsize14">主讲： {{course.teacherName}}&nbsp;&nbsp;&nbsp;</span>
              <span class="vam" v-if="!this.collectId" @click="addCourseCollect()">
                          <em class="icon18 scIcon ml10"></em>
                          <a class="c-666 vam ml10" title="收藏" >收藏</a>
              </span>
              <span class="vam sc-end" v-else>
                          <em class="icon18 scIcon ml10"></em>
                          <a class="c-666 vam ml10" title="取消收藏" @click="delCourseCollect()" style="color: #f4c600">取消收藏</a>
              </span>
            </section>
            <!--            <section class="mt15 mb15 of">-->

            <!--            </section>-->
            <section class="c-attr-mt" style="margin-top:30px ">
              <a href="#" title="立即观看" class="comm-btn c-btn-3" style="background-color: #6ACC7E" v-if="isbuyCourse||Number(course.price) === 0">立即观看</a>
              <a href="#" title="立即购买" class="comm-btn c-btn-3" v-else @click="createOrder()">立即购买</a>
            </section>
          </section>
        </aside>
        <aside class="thr-attr-box bg-0">
          <ol class="thr-attr-ol clearfix">
            <li>
              <p>&nbsp;</p>
              <aside>
                <span class="c-333 f-fM">购买数</span>
                <br>
                <h6 class="c-333 f-fM mt10">{{course.buyCount}}</h6>
              </aside>
            </li>
            <li>
              <p>&nbsp;</p>
              <aside>
                <span class="c-333 f-fM">课时数</span>
                <br>
                <h6 class="c-333 f-fM mt10">{{course.lessonNum}}</h6>
              </aside>
            </li>
            <li>
              <p>&nbsp;</p>
              <aside>
                <span class="c-333 f-fM">浏览数</span>
                <br>
                <h6 class="c-333 f-fM mt10">{{course.viewCount}}</h6>
              </aside>
            </li>
          </ol>
        </aside>
        <div class="clear"></div>
      </div>
      <!-- /课程封面介绍 -->
      <div class="mt20 c-infor-box">
        <article class="fl col-7">
          <section class="mr30">
            <div class="i-box">
              <div>
                <section id="c-i-tabTitle" class="c-infor-tabTitle c-tab-title">
                  <a name="c-i" class="current" title="课程详情">课程详情</a>
                </section>
              </div>
              <article class="ml10 mr10 pt20">
                <div>
                  <h6 class="c-i-content c-infor-title">
                    <span>课程介绍</span>
                  </h6>
                  <div class="course-txt-body-wrap">
                    <!--v-html 可以把html标签原样翻译-->
                    <section class="course-txt-body">
                      <div v-html="course.description"></div>
                    </section>
                  </div>
                </div>
                <!-- /课程介绍 -->
                <div class="mt50">
                  <h6 class="c-g-content c-infor-title">
                    <span>课程大纲</span>
                  </h6>
                  <section class="mt20">
                    <div class="lh-menu-wrap">
                      <menu id="lh-menu" class="lh-menu mt10 mr10">
                        <ul>
                          <!-- 文件目录 -->
<!--                          <li class="lh-menu-stair" v-for="chapter in chapterList" :key="chapter.id">-->
<!--                            <a href="javascript: void(0)" :title="chapter.title" class="current-1">-->
<!--                              <em class="lh-menu-i-1 icon18 mr10"/>{{chapter.title}}-->
<!--                            </a>-->
<!--                            <ol class="lh-menu-ol" style="display: block;">-->
<!--                              <li class="lh-menu-second ml30" v-for="video in chapter.children" :key="video.id">-->
<!--                                <a @click="watchVideo(video.videoSourceId)" title>-->
<!--                                  <span class="fr">-->
<!--                                    <i class="free-icon vam mr10" >观看视频</i>-->
<!--                                  </span>-->
<!--                                  <em class="lh-menu-i-2 icon16 mr5">&nbsp;</em>{{video.title}}-->
<!--                                </a>-->
<!--                              </li>-->
<!--                            </ol>-->
<!--                          </li>-->
                          <el-collapse v-model="activeNames" v-for="(chapter,index) in chapterList" :key="chapter.id">
                            <el-collapse-item :title="chapter.title" :name="index">
                              <ol class="lh-menu-ol" style="display: block;">
                                <li class="lh-menu-second ml30" v-for="video in chapter.children" :key="video.id" style="margin-top: 20px">
                                  <a @click="watchVideo(video.videoSourceId,chapter.id)" title style="cursor:pointer" target="_blank">
                                  <span class="fr">
                                    <i class="free-icon vam mr10" >观看视频</i>
                                  </span>
                                    <em class="lh-menu-i-2 icon16 mr5">&nbsp;</em>{{video.title}}
                                  </a>
                                </li>
                              </ol>
                            </el-collapse-item>
                          </el-collapse>
                        </ul>
                      </menu>
                    </div>
                  </section>
                </div>
                <!-- /课程大纲 -->
              </article>
            </div>
          </section>
        </article>
        <aside class="fl col-3">
          <div class="i-box">
            <div>
              <section class="c-infor-tabTitle c-tab-title">
                <a title href="javascript:void(0)">主讲讲师</a>
              </section>
              <section class="stud-act-list">
                <ul style="height: auto;">
                  <li>
                    <div class="u-face">
                      <a :href="'/teacher/'+course.teacherId">
                        <img :src="course.avatar" width="50" height="50" alt>
                      </a>
                    </div>
                    <section class="hLh30 txtOf">
                      <a class="c-333 fsize16 fl" href="#">{{course.teacherName}}</a>
                    </section>
                    <section class="hLh20 txtOf">
                      <span class="c-999">{{course.intro}}</span>
                    </section>
                  </li>
                </ul>
              </section>
            </div>
          </div>
        </aside>
        <div class="clear"/>
      </div>
      <!-- /评论 开始 -->
      <div class="mt50 commentHtml">
        <div>
          <h6 class="c-c-content c-infor-title" id="i-art-comment">
            <span class="commentTitle">课程评论</span>
          </h6>
          <section class="lh-bj-list pr mt20 replyhtml">
            <ul>
              <li class="unBr">
                <aside class="noter-pic">
                  <img width="50" height="50" class="picImg" src="~/assets/img/avatar-boy.gif">
                </aside>
                <div class="of">
                  <section class="n-reply-wrap">
                    <fieldset>
                      <el-input type="textarea" name="" v-model="comment.content" placeholder="输入您要评论的文字"
                                maxlength="300" show-word-limit
                                id="commentContent"
                                :rules="[{ required: true, message: '不能为空', trigger: 'blur' },]"></el-input>
                    </fieldset>
                    <p class="of mt5 tar pl10 pr10">
                      <span class="fl "><tt class="c-red commentContentmeg" style="display: none;"></tt></span>
                      <el-button type="primary" @click="addComment()" v-if="comment.content">评论</el-button>
                      <el-button type="primary" v-else disabled>评论</el-button>
                    </p>
                  </section>
                </div>
              </li>
            </ul>
          </section>
          <section class="">
            <div class="container">
              <div class="comment" v-for="(item,index) in data.items" :key="item.id">
                <div class="info">
                  <img class="avatar" :src="item.avatar" width="45" height="45"/>
                  <div class="right">
                    <div class="name">{{item.nickname}}</div>
                    <div class="date">{{item.gmtCreate}}</div>
                  </div>
                </div>
                <div class="content">{{item.content}}</div>
                <div class="control">
<!--                  <span class="like" :class="{active: item.isLike}" @click="likeClick(item)">-->
<!--                    <i class="iconfont icon-like"></i>-->
<!--                    <span class="like-num">{{Number(item.likeNum) > 0 ? item.likeNum + '人赞' : '赞'}}</span>-->
<!--                  </span>-->
                  <span class="comment-reply" @click="showCommentInput(item)">
                    <i class="iconfont icon-comment"></i>
                    <span>回复</span>
                  </span>
                </div>
                <div class="reply">
                  <div class="item" v-for="reply in data.items[index].commentReplies"
                       v-if="data.items[index].commentReplies.length > 0" :key="reply.id">
                    <div class="reply-content">
                      <img class="avatar" :src="reply.avatar" width="32" height="32" style="border-radius: 50%;"/>
                      &nbsp;&nbsp;&nbsp;
                      <span class="from-name" style="color: #6e6262">{{reply.nickname}}</span><span>回复 </span>
                      <span class="to-name">@{{item.nickname}}</span>
                      <span>：{{reply.content}}</span>
                    </div>
                    <div class="reply-bottom">
                      <span>{{reply.gmtCreate}}</span>
                      <span class="reply-text" @click="showCommentInput(item, reply)">
                        <i class="iconfont icon-comment"></i>
                        <span>回复</span>
                      </span>
                    </div>
                  </div>
                  <div class="write-reply" @click="showCommentInput(item)">
                    <i class="el-icon-edit"></i>
                    <span class="add-comment">添加新评论</span>
                  </div>
                  <transition name="fade">
                    <div class="input-wrapper" v-if="showItemId === item.id">
                      <el-input class="gray-bg-input"
                                v-model="inputComment"
                                type="textarea"
                                :rows="3"
                                autofocus
                                :placeholder="inputPlaceholder"
                                :rules="[{ required: true, message: '不能为空', trigger: 'blur' },]"
                      >
                      </el-input>
                      <div class="btn-control">
                        <span class="cancel" @click="cancel">取消</span>
                        <el-button class="btn" type="success" round @click="commitComment" v-if="inputComment">确定
                        </el-button>
                        <el-button class="btn" type="success" round v-else disabled>确定</el-button>
                      </div>
                    </div>
                  </transition>
                </div>
              </div>
            </div>
          </section>

          <!-- 公共分页 开始 -->
          <div class="paging">
            <!-- undisable这个class是否存在，取决于数据属性hasPrevious -->
            <a
              :class="{undisable: !data.hasPrevious}"
              href="#"
              title="首页"
              @click.prevent="gotoPage(1)">首</a>
            <a
              :class="{undisable: !data.hasPrevious}"
              href="#"
              title="前一页"
              @click.prevent="gotoPage(data.current-1)">&lt;</a>
            <a
              v-for="page in data.pages"
              :key="page"
              :class="{current: data.current == page, undisable: data.current == page}"
              :title="'第'+page+'页'"
              href="#"
              @click.prevent="gotoPage(page)">{{ page }}</a>
            <a
              :class="{undisable: !data.hasNext}"
              href="#"
              title="后一页"
              @click.prevent="data.hasNext?gotoPage(data.current+1):''">&gt;</a>
            <a
              :class="{undisable: !data.hasNext}"
              href="#"
              title="末页"
              @click.prevent="gotoPage(data.pages)">末</a>
            <div class="clear"/>
          </div>
          <!-- 公共分页 结束 -->
        </div>

        <!-- /评论 结束 -->
      </div>
    </section>
    <!-- /课程详情 结束 -->

  </div>
</template>

<script>
  import courseApi from "../../api/course";
  import commentApi from "../../api/comment";
  import comment from "../../api/comment";
  import orderApi from "../../api/order";
  import cookie from 'js-cookie'
  import Vue from "vue";
  import teacher from "../../api/teacher";

  export default {
    // props: {
    //   comments: {
    //     type: Array,
    //     required: true
    //   }
    // },
    data() {
      return {
        courseId: this.$route.params.id,
        data: {},
        page: 1,
        limit: 4,
        total: 10,
        comment: {
          content: '',
          courseId: ''
        },
        course: {},
        chapterList: {},
        isbuyCourse: false,
        commentReply: {
          content: '',//回复评论内容
          courseId: '',//课程id
          fromId: '',//回复该评论的id
          commentId: '',//父评论id
        },
        inputComment: '',//回复评论内容
        inputPlaceholder: '',//Placeholder的内容
        showItemId: '',
        commentInfo: {},
        orderId: '',//订单id
        collectId:'',//课程收藏id
        activeNames: ['1'],
        teacher: {},
      }
    },
    created() {
      this.getCourseCollect();
      this.addViewCount();
      this.initCourseInfo();
      this.initComment();
    },
    methods: {
      //添加收藏
      addCourseCollect(){
        if (!cookie.get("edu_token")){
          this.$message({
            message: "您还未登录，请先前往登录",
            type: "warning",
            // onClose() {
            //   var forward = getUrlQuery().forward;  //拿到上个页面传参url
            //   window.location = "http://localhost:3000/login"
            // },
          })
        }
        else{
          courseApi.addCourseCollect(this.courseId)
          .then(resp=>{
            this.collectId = resp.data.data.collectId;
            this.$message({
              message: "收藏成功",
              type: "success",
            })
          })
        }
      },
      //取消收藏
      delCourseCollect(){
        courseApi.delCourseCollect(this.collectId)
        .then(resp=>{
          this.$message({
            message: "取消收藏成功",
            type: "success",
          })
          this.getCourseCollect()
        })
      },

      //查看课程是否收藏
      getCourseCollect(){
        if (cookie.get("edu_token")){
          courseApi.getCourseCollect(this.courseId)
          .then(resp=>{
            if(resp.data.data.collectId ==-1){
              this.collectId = '';
            }
            else{
              this.collectId = resp.data.data.collectId;
            }

          })
        }
      },

      //每浏览网页一次增加课程浏览量
      addViewCount(){
        courseApi.addCourseViewCount(this.courseId)
        .then();
      },
      //生成订单
      createOrder() {
        if (!cookie.get("edu_token")) {
          this.$message({
            message: "您还未登录，请先前往登录",
            type: "warning",
            // onClose() {
            //   var forward = getUrlQuery().forward;  //拿到上个页面传参url
            //   window.location = "http://localhost:3000/login"
            // },
          })

          return false;
        }
        orderApi.createOrder(this.courseId)
          .then(resp => {
            //获取订单号
            this.orderId = resp.data.data.orderId;
            //生成订单后，跳转到订单显示页面
            this.$router.push({path: '/order/' + this.orderId});
          })
      },

      /**
       * 点击观看视频前验证是否登录
       * */
      watchVideo(videoId,chapterId){
        if (!cookie.get("edu_token")) {
          this.$message({
            message: "您还未登录，请先前往登录",
            type: "warning",
            // onClose() {
            //   var forward = getUrlQuery().forward;  //拿到上个页面传参url
            //   window.location = "http://localhost:3000/login"
            // },
          })
        }
        else
        {
          if(videoId==""){
            this.$message({
              message: "当前课程下暂无视频",
              type: "warning",
            })
          }
          else{
            const routeUrl = this.$router.resolve({
              path: '/player/'+videoId,
              query: {
                chapterId: chapterId,
                courseId: this.courseId,
                teacherName:this.teacher.teacherName,
                teacherId:this.teacher.id,
                avatar:this.teacher.avatar,
              }
            })
            window.open(routeUrl.href, '_blank')

            // this.$router.push({path:'/player/'+videoId})
          }
        }
      },




      /**
       * 点击取消按钮
       */
      cancel() {
        this.showItemId = ''
        this.commentReply.commentId = ''
        this.inputPlaceholder = ''
        this.inputComment = ''
      },

      /**
       * 提交评论
       */
      commitComment() {
        //先验证是否登录，如果未登录，给提示
        if (!cookie.get('edu_token')) {
          this.$message({
            message: "您还未登录，请先前往登录",
            type: "warning",
            // onClose() {
            //   window.location = "http://localhost:3000/login"
            // },
          })
          return false;
        }
        this.commentReply.content = this.inputComment;
        this.commentReply.courseId = this.$route.params.id;
        this.commentReply.teacherId = this.course.teacherId;
        //console.log(this.commentReply);
        commentApi.addCommentReply(this.commentReply)
          .then(resp => {
            if (resp.data.code == 20000) {
              this.$message.success("评论成功")
              this.comment.content = ''
              this.inputComment = ''
              this.initComment()
            }
          })
      },

      /**
       * 点击评论按钮显示输入框
       * item: 当前大评论
       * reply: 当前回复的评论
       */
      showCommentInput(item, reply) {
        if (reply) {
          this.inputPlaceholder = "@" + reply.nickname + " "
          this.commentReply.fromId = reply.fromId;
        } else {
          this.inputComment = ''
          this.inputPlaceholder = "@" + item.nickname + " "
          this.commentReply.fromId = item.id;
        }
        this.showItemId = item.id
        this.commentReply.commentId = item.id;
      },


      //初始化course
      initCourseInfo() {
        courseApi.getCourseInfo(this.courseId).then(resp => {
          this.course = resp.data.data.courseWebVo
          this.chapterList = resp.data.data.chapterVideoList
          this.isbuyCourse = resp.data.data.isBuy
          this.teacher.id = this.course.teacherId;
          this.teacher.teacherName = this.course.teacherName;
          this.teacher.avatar = this.course.avatar;
          //console.log("wwww:" + this.isbuyCourse)
          // this.isbuyCourse=resp.data.data.isbuy
        })
      },
      //初始化评论
      initComment() {
        commentApi.getCommentPage(this.page, this.limit, this.courseId)
          .then(resp => {
            this.data = resp.data.data;
            //this.commentInfo = JSON.stringify(this.data);
            //console.log(this.data.items[1].commentReplies);
            //console.log(this.data)
          })
      },
      gotoPage(page) {
        commentApi.getCommentPage(page, this.limit, this.courseId)
          .then(resp => {
            this.data = resp.data.data;
          })
      },
      //添加评论
      addComment() {
        //先验证是否登录，如果未登录，给提示
        if (!cookie.get('edu_token')) {
          this.$message({
            message: "您还未登录，请先前往登录",
            type: "warning",
            onClose() {
              window.location = "http://localhost:3000/login"
            },
          })
          return false;
        }
        this.comment.courseId = this.$route.params.id;
        this.comment.teacherId = this.course.teacherId;
        //添加评论到数据库
        commentApi.addComment(this.comment)
          .then(resp => {
            if (resp.data.code == 20000) {
              this.$message.success("评论成功")
              this.comment.content = ''
              this.initComment()
            }
          })
      }
    },
    //异步调用
    // asyncData({params,error}){
    //   return courseApi.getCourseInfo(params.id)
    //   .then(resp=>{
    //     return {
    //       course : resp.data.data.courseWebVo,
    //       chapterList : resp.data.data.chapterVideoList
    //     }
    //     //console.log(chapterList.children.videoSourceId)
    //   })
    // }
    /**
     * 点赞
     */
    // likeClick(item) {
    //   // 判断是否登录
    //   if(!cookie.get("edu_token")){
    //     this.$message({
    //       message: "您还未登录，请先前往登录",
    //       type: "warning",
    //       // onClose() {
    //       //   var forward = getUrlQuery().forward;  //拿到上个页面传参url
    //       //   window.location = "http://localhost:3000/login"
    //       // },
    //     })
    //   }
    //   else{
    //     var memberId = '';
    //     //查询在线的用户id
    //     courseApi.queryUserId()
    //     .then(resp=>{
    //       memberId = resp.data.data.memberId;
    //     })
    //     //如果isLike是空就可以点赞
    //     if (item.isLike == 0) {
    //       if(item.memberId==memberId){
    //         item.isLike = 1;
    //       }
    //       item.likeNum++
    //     }
    //     //如果已经点赞就减
    //     else {
    //       if (item.isLike&&item.memberId==memberId) {
    //         item.likeNum--
    //       } else {
    //         item.likeNum++
    //       }
    //       item.isLike = !item.isLike;
    //     }
    //     commentApi.likeNum(item)
    //       .then(resp => {
    //         this.initComment()
    //       })
    //   }
    //
    //
    // },
  }
</script>
<style scoped lang="scss">

  @import "./index";

  .container {
    padding: 0 10px;
    box-sizing: border-box;

    .comment {
      display: flex;
      flex-direction: column;
      padding: 10px;
      border-bottom: 1px solid $border-fourth;

      .info {
        display: flex;
        align-items: center;

        .avatar {
          border-radius: 50%;
        }

        .right {
          display: flex;
          flex-direction: column;
          margin-left: 10px;

          .name {
            font-size: 16px;
            color: $text-main;
            margin-bottom: 5px;
            font-weight: 500;
          }

          .date {
            font-size: 12px;
            color: $text-minor;
          }
        }
      }

      .content {
        font-size: 16px;
        color: $text-main;
        line-height: 20px;
        padding: 10px 0;
      }

      .control {
        display: flex;
        align-items: center;
        font-size: 14px;
        color: $text-minor;

        .like {
          display: flex;
          align-items: center;
          margin-right: 20px;
          cursor: pointer;

          &.active, &:hover {
            color: $color-main;
          }

          .iconfont {
            font-size: 14px;
            margin-right: 5px;
          }
        }

        .comment-reply {
          display: flex;
          align-items: center;
          cursor: pointer;

          &:hover {
            color: $text-333;
          }

          .iconfont {
            font-size: 16px;
            margin-right: 5px;
          }
        }

      }

      .reply {
        margin: 10px 0;
        border-left: 2px solid $border-first;

        .item {
          margin: 0 10px;
          padding: 10px 0;
          border-bottom: 1px dashed $border-third;

          .reply-content {
            display: flex;
            align-items: center;
            font-size: 14px;
            color: $text-main;

            .from-name {
              color: $color-main;
            }

            .to-name {
              color: $color-main;
              margin-left: 5px;
              margin-right: 5px;
            }
          }

          .reply-bottom {
            display: flex;
            align-items: center;
            margin-top: 6px;
            font-size: 12px;
            color: $text-minor;

            .reply-text {
              display: flex;
              align-items: center;
              margin-left: 10px;
              cursor: pointer;

              &:hover {
                color: $text-333;
              }

              .icon-comment {
                margin-right: 5px;
              }
            }
          }
        }

        .write-reply {
          display: flex;
          align-items: center;
          font-size: 14px;
          color: $text-minor;
          padding: 10px;
          cursor: pointer;

          &:hover {
            color: $text-main;
          }

          .el-icon-edit {
            margin-right: 5px;
          }
        }

        .fade-enter-active, fade-leave-active {
          transition: opacity 0.5s;
        }

        .fade-enter, .fade-leave-to {
          opacity: 0;
        }

        .input-wrapper {
          padding: 10px;

          .gray-bg-input, .el-input__inner {
            /*background-color: #67C23A;*/
          }

          .btn-control {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            padding-top: 10px;

            .cancel {
              font-size: 16px;
              color: $text-normal;
              margin-right: 20px;
              cursor: pointer;

              &:hover {
                color: $text-333;
              }
            }

            .confirm {
              font-size: 16px;
            }
          }
        }
      }
    }
  }


  body {
    text-align: left;
    color: #424242;
    font-size: 14px;
    line-height: 1.75;
    background: #fff;
  }

  .c-v-pic-wrap {
    width: 540px;
    height: 305px;
  }

  .thr-attr-box {
    background: #fff;
    width: 178px;
    height: 305px;
  }

  .thr-attr-ol li {
    border-bottom: 1px solid #f1f1f1;
    height: 33.33%;
    width: 100%;
    text-align: center;
    display: block;
  }

  .c-333 {
    color: #333;
  }

  [v-cloak] {
    display: none !important;
  }

  .ml10 {
    margin-left: 10px;
  }

  .has-button {
    width: 120px;
    background: #f4fafe;
    border-radius: 4px;
    padding: 20px;
    font-size: 16px;
    font-weight: 400;
    color: #999;
    line-height: 16px;
    box-sizing: border-box;
    cursor: pointer;
  }

  .c-btn-3 {
    bdisplay: block;
    width: 136px;
    height: 36px;
    color: #fff;
    background: #d51423;
    border: none;
    border-radius: 6px;
    line-height: 36px;
    text-align: center;
    font-size: 14px;
  }

  .menu-chapter {
    margin: 10px 0;
    background: #eee;
  }

  .current-1 {
    color: #666 !important;
    font-size: 1rem;
    font-weight: 400;
  }

  .lab-item {
    margin-bottom: 10px;
    border: 1px solid #eee;
  }

  .period_top {
    width: 627px;
    padding-left: 20px;
    height: 46px;
    line-height: 46px;
    position: relative;
    padding-right: 104px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

  }

  .period_top .period_video {
    display: inline-block;
    width: 21px;
    height: 21px;
    position: relative;
    top: 6px;
    margin-right: 10px;
    background: url("./static/d372b85.svg") 50%;
    background-size: 21px 21px;

  }

  .c_blue {
    color: #107ec4;
  }

  .period_top .video_time {
    position: absolute;
    right: 0;
  }

  .fr {
    float: right;
  }

  .period_top.on, .period_top:hover {
    cursor: pointer;
    background: #f2f2f2;
    color: #d51423;
  }

  .period_top.on .period_video, .period_top:hover .period_video {
    background: url("./static/e8e8de1.png") 50%;
  }

  /*
    .commentHtml{
      width: 70%;
      margin: 50px auto;
    }*/

</style>
